<!-- HTML header for doxygen 1.8.14-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="cache-control" content="max-age=86400"/>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>GBDK 2020 Docs: gbdk-lib/include/gbdk/far_ptr.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen_extra.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">GBDK 2020 Docs
   &#160;<span id="projectnumber">4.4.0</span>
   </div>
   <div id="projectbrief">API Documentation for GBDK 2020</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('far__ptr_8h_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">far_ptr.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="far__ptr_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160; </div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">#ifndef __FAR_PTR_H_INCLUDE</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="preprocessor">#define __FAR_PTR_H_INCLUDE</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160; </div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="preprocessor">#include &lt;types.h&gt;</span></div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="stdint_8h.html">stdint.h</a>&gt;</span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160; </div>
<div class="line"><a name="l00025"></a><span class="lineno"><a class="line" href="far__ptr_8h.html#a0c227677a96f9bf7e84a90922f2f8708">   25</a></span>&#160;<span class="preprocessor">#define TO_FAR_PTR(ofs, seg) (((FAR_PTR)seg &lt;&lt; 16) | (FAR_PTR)ofs)</span></div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160; </div>
<div class="line"><a name="l00032"></a><span class="lineno"><a class="line" href="far__ptr_8h.html#a5bebc5322a1bba1c60c8d60e9b58be14">   32</a></span>&#160;<span class="preprocessor">#define FAR_SEG(ptr) (((union __far_ptr *)&amp;ptr)-&gt;segofs.seg)</span></div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160; </div>
<div class="line"><a name="l00039"></a><span class="lineno"><a class="line" href="far__ptr_8h.html#ab79586d8cc3cb926f363f4d0cf7143d5">   39</a></span>&#160;<span class="preprocessor">#define FAR_OFS(ptr) (((union __far_ptr *)&amp;ptr)-&gt;segofs.ofs)</span></div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160; </div>
<div class="line"><a name="l00041"></a><span class="lineno"><a class="line" href="far__ptr_8h.html#a048cfacb5d37ab758a74f44e86c1dbc6">   41</a></span>&#160;<span class="preprocessor">#define FAR_FUNC(ptr, typ) ((typ)(((union __far_ptr *)&amp;ptr)-&gt;segfn.fn))</span></div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160; </div>
<div class="line"><a name="l00065"></a><span class="lineno"><a class="line" href="far__ptr_8h.html#a7f4ab1893ea392f8bf042a3b97de4730">   65</a></span>&#160;<span class="preprocessor">#define FAR_CALL(ptr, typ, ...) (__call_banked_ptr=ptr,((typ)(&amp;__call__banked))(__VA_ARGS__))</span></div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160; </div>
<div class="line"><a name="l00069"></a><span class="lineno"><a class="line" href="far__ptr_8h.html#a7c6f52121dd07af29b477f4e64314842">   69</a></span>&#160;<span class="keyword">typedef</span> <a class="code" href="stdint_8h.html#a33594304e786b158f3fb30289278f5af">uint32_t</a> <a class="code" href="far__ptr_8h.html#a7c6f52121dd07af29b477f4e64314842">FAR_PTR</a>;</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160; </div>
<div class="line"><a name="l00073"></a><span class="lineno"><a class="line" href="union____far__ptr.html">   73</a></span>&#160;<span class="keyword">union </span><a class="code" href="union____far__ptr.html">__far_ptr</a> {</div>
<div class="line"><a name="l00074"></a><span class="lineno"><a class="line" href="union____far__ptr.html#afabdeeef2b4056bc9c2d2e34b030f348">   74</a></span>&#160;    <a class="code" href="far__ptr_8h.html#a7c6f52121dd07af29b477f4e64314842">FAR_PTR</a> <a class="code" href="union____far__ptr.html#afabdeeef2b4056bc9c2d2e34b030f348">ptr</a>;</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;    <span class="keyword">struct </span>{</div>
<div class="line"><a name="l00076"></a><span class="lineno"><a class="line" href="union____far__ptr.html#a60fef2b4efac12d73fd609373631ac4e">   76</a></span>&#160;        <span class="keywordtype">void</span> * <a class="code" href="union____far__ptr.html#a60fef2b4efac12d73fd609373631ac4e">ofs</a>;</div>
<div class="line"><a name="l00077"></a><span class="lineno"><a class="line" href="union____far__ptr.html#a13c65a38be633a3ac219c3b5b3be5ce6">   77</a></span>&#160;        <a class="code" href="stdint_8h.html#adf4d876453337156dde61095e1f20223">uint16_t</a> <a class="code" href="union____far__ptr.html#a13c65a38be633a3ac219c3b5b3be5ce6">seg</a>;</div>
<div class="line"><a name="l00078"></a><span class="lineno"><a class="line" href="union____far__ptr.html#adb3ec83d8484f0dedfa9f5fa61490763">   78</a></span>&#160;    } <a class="code" href="union____far__ptr.html#adb3ec83d8484f0dedfa9f5fa61490763">segofs</a>;</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;    <span class="keyword">struct </span>{</div>
<div class="line"><a name="l00080"></a><span class="lineno"><a class="line" href="union____far__ptr.html#a3eb7f6a847a1711cf83ffddf567688b4">   80</a></span>&#160;        void (*<a class="code" href="union____far__ptr.html#a3eb7f6a847a1711cf83ffddf567688b4">fn</a>)(void);</div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;        <a class="code" href="stdint_8h.html#adf4d876453337156dde61095e1f20223">uint16_t</a> <a class="code" href="union____far__ptr.html#a13c65a38be633a3ac219c3b5b3be5ce6">seg</a>;</div>
<div class="line"><a name="l00082"></a><span class="lineno"><a class="line" href="union____far__ptr.html#a9275e86d4ae8df808070a57df1eb5e21">   82</a></span>&#160;    } <a class="code" href="union____far__ptr.html#a9275e86d4ae8df808070a57df1eb5e21">segfn</a>;</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;};</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160; </div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;<span class="keyword">extern</span> <span class="keyword">volatile</span> <a class="code" href="far__ptr_8h.html#a7c6f52121dd07af29b477f4e64314842">FAR_PTR</a> <a class="code" href="far__ptr_8h.html#a27792b7fc3796a1e1828d4c5812e5b21">__call_banked_ptr</a>;</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;<span class="keyword">extern</span> <span class="keyword">volatile</span> <span class="keywordtype">void</span> * <a class="code" href="far__ptr_8h.html#a1344c26ca298a9eadea4bcfea6442ae3">__call_banked_addr</a>;</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;<span class="keyword">extern</span> <span class="keyword">volatile</span> <a class="code" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> <a class="code" href="far__ptr_8h.html#a892433d652420445a9a6aebf1a256623">__call_banked_bank</a>;</div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160; </div>
<div class="line"><a name="l00089"></a><span class="lineno"><a class="line" href="far__ptr_8h.html#aedacafa73ba2c54e49976dccfc83b40b">   89</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="far__ptr_8h.html#aedacafa73ba2c54e49976dccfc83b40b">__call__banked</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160; </div>
<div class="line"><a name="l00097"></a><span class="lineno"><a class="line" href="far__ptr_8h.html#ad5987288bdbbd891b56754122a2d53d3">   97</a></span>&#160;<a class="code" href="stdint_8h.html#a33594304e786b158f3fb30289278f5af">uint32_t</a> <a class="code" href="far__ptr_8h.html#ad5987288bdbbd891b56754122a2d53d3">to_far_ptr</a>(<span class="keywordtype">void</span>* ofs, <a class="code" href="stdint_8h.html#adf4d876453337156dde61095e1f20223">uint16_t</a> seg);</div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160; </div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="ttc" id="afar__ptr_8h_html_a1344c26ca298a9eadea4bcfea6442ae3"><div class="ttname"><a href="far__ptr_8h.html#a1344c26ca298a9eadea4bcfea6442ae3">__call_banked_addr</a></div><div class="ttdeci">volatile void * __call_banked_addr</div></div>
<div class="ttc" id="afar__ptr_8h_html_a27792b7fc3796a1e1828d4c5812e5b21"><div class="ttname"><a href="far__ptr_8h.html#a27792b7fc3796a1e1828d4c5812e5b21">__call_banked_ptr</a></div><div class="ttdeci">volatile FAR_PTR __call_banked_ptr</div></div>
<div class="ttc" id="afar__ptr_8h_html_a7c6f52121dd07af29b477f4e64314842"><div class="ttname"><a href="far__ptr_8h.html#a7c6f52121dd07af29b477f4e64314842">FAR_PTR</a></div><div class="ttdeci">uint32_t FAR_PTR</div><div class="ttdef"><b>Definition:</b> far_ptr.h:69</div></div>
<div class="ttc" id="afar__ptr_8h_html_a892433d652420445a9a6aebf1a256623"><div class="ttname"><a href="far__ptr_8h.html#a892433d652420445a9a6aebf1a256623">__call_banked_bank</a></div><div class="ttdeci">volatile uint8_t __call_banked_bank</div></div>
<div class="ttc" id="afar__ptr_8h_html_ad5987288bdbbd891b56754122a2d53d3"><div class="ttname"><a href="far__ptr_8h.html#ad5987288bdbbd891b56754122a2d53d3">to_far_ptr</a></div><div class="ttdeci">uint32_t to_far_ptr(void *ofs, uint16_t seg)</div></div>
<div class="ttc" id="afar__ptr_8h_html_aedacafa73ba2c54e49976dccfc83b40b"><div class="ttname"><a href="far__ptr_8h.html#aedacafa73ba2c54e49976dccfc83b40b">__call__banked</a></div><div class="ttdeci">void __call__banked(void)</div></div>
<div class="ttc" id="astdint_8h_html"><div class="ttname"><a href="stdint_8h.html">stdint.h</a></div></div>
<div class="ttc" id="astdint_8h_html_a33594304e786b158f3fb30289278f5af"><div class="ttname"><a href="stdint_8h.html#a33594304e786b158f3fb30289278f5af">uint32_t</a></div><div class="ttdeci">unsigned long int uint32_t</div><div class="ttdef"><b>Definition:</b> stdint.h:53</div></div>
<div class="ttc" id="astdint_8h_html_aba7bc1797add20fe3efdf37ced1182c5"><div class="ttname"><a href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a></div><div class="ttdeci">unsigned char uint8_t</div><div class="ttdef"><b>Definition:</b> stdint.h:51</div></div>
<div class="ttc" id="astdint_8h_html_adf4d876453337156dde61095e1f20223"><div class="ttname"><a href="stdint_8h.html#adf4d876453337156dde61095e1f20223">uint16_t</a></div><div class="ttdeci">unsigned short int uint16_t</div><div class="ttdef"><b>Definition:</b> stdint.h:52</div></div>
<div class="ttc" id="aunion____far__ptr_html"><div class="ttname"><a href="union____far__ptr.html">__far_ptr</a></div><div class="ttdef"><b>Definition:</b> far_ptr.h:73</div></div>
<div class="ttc" id="aunion____far__ptr_html_a13c65a38be633a3ac219c3b5b3be5ce6"><div class="ttname"><a href="union____far__ptr.html#a13c65a38be633a3ac219c3b5b3be5ce6">__far_ptr::seg</a></div><div class="ttdeci">uint16_t seg</div><div class="ttdef"><b>Definition:</b> far_ptr.h:77</div></div>
<div class="ttc" id="aunion____far__ptr_html_a3eb7f6a847a1711cf83ffddf567688b4"><div class="ttname"><a href="union____far__ptr.html#a3eb7f6a847a1711cf83ffddf567688b4">__far_ptr::fn</a></div><div class="ttdeci">void(* fn)(void)</div><div class="ttdef"><b>Definition:</b> far_ptr.h:80</div></div>
<div class="ttc" id="aunion____far__ptr_html_a60fef2b4efac12d73fd609373631ac4e"><div class="ttname"><a href="union____far__ptr.html#a60fef2b4efac12d73fd609373631ac4e">__far_ptr::ofs</a></div><div class="ttdeci">void * ofs</div><div class="ttdef"><b>Definition:</b> far_ptr.h:76</div></div>
<div class="ttc" id="aunion____far__ptr_html_a9275e86d4ae8df808070a57df1eb5e21"><div class="ttname"><a href="union____far__ptr.html#a9275e86d4ae8df808070a57df1eb5e21">__far_ptr::segfn</a></div><div class="ttdeci">struct __far_ptr::@8 segfn</div></div>
<div class="ttc" id="aunion____far__ptr_html_adb3ec83d8484f0dedfa9f5fa61490763"><div class="ttname"><a href="union____far__ptr.html#adb3ec83d8484f0dedfa9f5fa61490763">__far_ptr::segofs</a></div><div class="ttdeci">struct __far_ptr::@7 segofs</div></div>
<div class="ttc" id="aunion____far__ptr_html_afabdeeef2b4056bc9c2d2e34b030f348"><div class="ttname"><a href="union____far__ptr.html#afabdeeef2b4056bc9c2d2e34b030f348">__far_ptr::ptr</a></div><div class="ttdeci">FAR_PTR ptr</div><div class="ttdef"><b>Definition:</b> far_ptr.h:74</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.14-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
</div>
</body>
</html>
